package com.hqyj.fj.javaSpringBoot.modules.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ImageType {
    PROFILE_BIG("profile-big", 100, 220, 220),
    PROFILE_SMALL("profile-small", 20, 50, 50);

    public  String  name;
    public  int size;
    public  int length;
    public  int height;

    ImageType(String name, int size, int length, int height) {
        this.name = name;
        this.size = size;
        this.length = length;
        this.height = height;
    }
public  static ImageType getImageTypeName(String name){
        for (ImageType imagType: ImageType.values()){
            if (imagType.name.equals(name)){
                return  imagType;
            }
        }
        return null;
}
//    public static void main(String[] args) {
//        System.out.println(ImagType.valueOf("PROFILE_BIG").size);
//    }
}
